package com.lb.jwitter.service;

import java.io.Serializable;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.jws.WebService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lb.jwitter.*;
import com.lb.jwitter.hibernate.*;
import com.lb.jwitter.util.ConditionReport;

@Service("tbl_QLDTTXA_DM_KetQuaService")
@Transactional
@WebService(endpointInterface = "com.lb.jwitter.service.Tbl_QLDTTXA_DM_KetQuaService")
public class Tbl_QLDTTXA_DM_KetQuaServiceImpl implements Tbl_QLDTTXA_DM_KetQuaService,Serializable {

   private Log log = LogFactory.getLog(Tbl_QLDTTXA_DM_KetQuaServiceImpl.class);
   private static final long serialVersionUID = -8740095022264495229L;

   @Autowired
   @Qualifier("tbl_QLDTTXA_DM_KetQuaDAO")
   private Tbl_QLDTTXA_DM_KetQuaDAO _tbl_QLDTTXA_DM_KetQuaDao;

   public final List<Tbl_QLDTTXA_DM_KetQua> findAlltbl_QLDTTXA_DM_KetQua(int pageSize, int page){
   List<Tbl_QLDTTXA_DM_KetQua> result = get_tbl_QLDTTXA_DM_KetQuaDao().findAll(pageSize, page);
       log.info("Number of user in DB:: "+result.size());
       return result;
   }

   @Transactional(noRollbackFor=IllegalArgumentException.class)
   public final Long createtbl_QLDTTXA_DM_KetQua(Tbl_QLDTTXA_DM_KetQua obj){
       return _tbl_QLDTTXA_DM_KetQuaDao.save(obj);
   }

   public final void updatetbl_QLDTTXA_DM_KetQua(Tbl_QLDTTXA_DM_KetQua obj){
       _tbl_QLDTTXA_DM_KetQuaDao.update(obj);
   }//end update methode

   public final Tbl_QLDTTXA_DM_KetQua gettbl_QLDTTXA_DM_KetQua (Long id){
       log.info("Try to retrieve the tbl_QLDTTXA_DM_KetQua: "+id);
       return get_tbl_QLDTTXA_DM_KetQuaDao().get(id);
   }

   public void deletetbl_QLDTTXA_DM_KetQua(Long id){
       log.info("Try to delete the tbl_QLDTTXA_DM_KetQua by Id : "+ id);
       if(_tbl_QLDTTXA_DM_KetQuaDao.exists(id)){
	    _tbl_QLDTTXA_DM_KetQuaDao.delete(id);
       } else {
       	throw new IllegalArgumentException("EmployeeId '"+id+"' does not exists");
       }
   }

   public void deleteListtbl_QLDTTXA_DM_KetQua(String[] listId){
       for(String id : listId){
   	    deletetbl_QLDTTXA_DM_KetQua(Long.parseLong(id));
       }
   }

   public List<Tbl_QLDTTXA_DM_KetQua> findtbl_QLDTTXA_DM_KetQuaByCondition(List<ConditionReport> cons,int pageSize,int page){ 
       return _tbl_QLDTTXA_DM_KetQuaDao.findByCondition(Tbl_QLDTTXA_DM_KetQua.class, cons, pageSize, page); 
   } 
 
   public int counttbl_QLDTTXA_DM_KetQuaByCondition(List<ConditionReport> cons){ 
       return _tbl_QLDTTXA_DM_KetQuaDao.findByCondition(Tbl_QLDTTXA_DM_KetQua.class, cons, 0, 0).size(); 
   } 
 
   public final Tbl_QLDTTXA_DM_KetQuaDAO get_tbl_QLDTTXA_DM_KetQuaDao() {
   	return _tbl_QLDTTXA_DM_KetQuaDao;
   }
   public final void set_tbl_QLDTTXA_DM_KetQuaDao(Tbl_QLDTTXA_DM_KetQuaDAO obj) {
   	this._tbl_QLDTTXA_DM_KetQuaDao = obj;
   }

}//endclass

